package club.lovety.springbase.prop;

import org.springframework.util.PropertyPlaceholderHelper;

import java.util.Properties;

public class PropertiesHelperTest {

    public static void main(String[] args) {

        PropertyPlaceholderHelper propertyPlaceholderHelper = new PropertyPlaceholderHelper("${", "}");

        Properties properties = new Properties();

        properties.put("name","你好");

        properties.put("age",123);

        properties.put("address","安徽");

        String str  = "name=${name}";

//        String result = propertyPlaceholderHelper.replacePlaceholders(str,properties::getProperty);
//
//        System.out.println(result);

        A a = new A();

        String p  = a.replacePlaceholders(properties::getProperty);

        System.out.println("p; "+ p);

    }

    static class A{

        public String replacePlaceholders(PlaceholderResolverTest placeholderResolverTest){
//            placeholderResolverTest.resolvePlaceholder()
            return "12321";
        }

    }



}
